#include <QStringListModel>

#include "listviewtest.h"

ListViewTest::ListViewTest(QWidget *parent, Qt::WFlags flags)
	: QMainWindow(parent, flags)
{
	ui.setupUi(this);
	connect(ui.pushButton, SIGNAL(clicked()), this, SLOT(addItem()));

	QStringList list;
	list.append("1");
	list.append("2");
	ui.listWidget->addItems(list);
}

ListViewTest::~ListViewTest()
{

}

void ListViewTest::addItem()
{
	QStringListModel * slm = new QStringListModel(this);
    QStringList sl;
    sl.append("asdfsadfgggggggggggggggggggggggggggsa");
    sl.append("asdfsadfsa");
    sl.append("asdfsadfsa");
    slm->setStringList(sl);
	ui.listView->setModel(slm);
}
